Skip to content

CI: Migrate to GitHub Actions#11

Merged
kou merged 4 commits intoclear-code:mainfrom
Watson1978:ci
Mar 10, 2026
Merged

CI: Migrate to GitHub Actions#11
kou merged 4 commits intoclear-code:mainfrom
Watson1978:ci

Conversation

@Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Mar 10, 2026

Fix #9

Thanks Travis CI for providing free CI resource so far!

@Watson1978 Watson1978 marked this pull request as ready for review March 10, 2026 01:06
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +29 to +40
- name: Replace libcurl.dll
if: runner.os == 'Windows'
run: |
# The `libcurl.dll` bundled with Ruby on Windows (MSYS2) has missing dependencies and cannot be loaded by `ethon` out of the box. (Ref: https://github.com/typhoeus/typhoeus/issues/720)
choco install curl --no-progress

$curlTools = "C:\ProgramData\chocolatey\lib\curl\tools"
$srcDll = Get-ChildItem -Path $curlTools -Filter "libcurl*.dll" -Recurse | Select-Object -First 1

$rubyBin = Split-Path (Get-Command ruby.exe).Source
$destDll = Join-Path $rubyBin "libcurl.dll"
Copy-Item -Path $srcDll.FullName -Destination $destDll -Force
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this is a wrong fix.

MSYS2 ships libcurl-4.dll not libcurl.dll:

https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-curl

/ucrt64/bin/libcurl-4.dll

I confirmed that ruby -r ethon -e; works with the following patch without copying libcurl.dll:

diff --git a/lib/ethon/curls/settings.rb b/lib/ethon/curls/settings.rb
index 8c0161b..e878c1a 100644
--- a/lib/ethon/curls/settings.rb
+++ b/lib/ethon/curls/settings.rb
@@ -7,6 +7,9 @@ module Ethon
     callback :debug_callback, [:pointer, :debug_info_type, :pointer, :size_t, :pointer], :int
     callback :progress_callback, [:pointer, :long_long, :long_long, :long_long, :long_long], :int
     ffi_lib_flags :now, :global
-    ffi_lib ['libcurl', 'libcurl.so.4']
+    # 'libcurl-4' is for MSYS2. MSYS2 uses libcurl-4.dll not libcurl.dll.
+    # See also "Files:" in
+    # https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-curl .
+    ffi_lib ['libcurl', 'libcurl.so.4', 'libcurl-4']
   end
 end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue has already been filed for a similar case.
typhoeus/ethon#270

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about removing this workaround and jobs on Windows until the issue is resolved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent a PR at typhoeus/ethon#271

@kou kou merged commit a15089f into clear-code:main Mar 10, 2026
17 checks passed
@Watson1978 Watson1978 deleted the ci branch March 10, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate CI to GitHub Actions from Travis CI

2 participants